<!--
 * @Author: wangwenshuai 644586996@qq.com
 * @Date: 2023-06-14 10:05:42
 * @LastEditors: wangwenshuai 644586996@qq.com
 * @LastEditTime: 2023-06-21 09:46:54
 * @FilePath: \carbon_jee\src\views\Accounting\Collect\Emission.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="Emission_box">
    <a-row style="padding: 10px 20px">

      <p class="Emission">碳排放量</p>
      <a-col :span="24">
        <a-table
          rowKey="key"
          :columns="columns1"
          :data-source="computedTableData"
          :pagination="false"
        ></a-table>
      </a-col>
    </a-row>
  </div>
</template>

<script>
const columns1 = [
  {
    dataIndex: "source",
    title: "源类别",
    key: "source",
    scopedSlots: { customRender: "source" },
  },
  {
    title: "排放量 单位：tCO₂e",
    dataIndex: "emission",
    key: "emission",
  },
];
// import { ListMixin } from "@/mixins/ListMixin";
export default {
  // mixins: [ListMixin],
  props: ["paneData"],
  data() {
    return {
      columns1,
    };
  },
  computed: {
    computedTableData() {
      //   console.log(this.paneData);
      var data = [];
      var emissionObject = this.paneData.emissionStatList;
      for (var i = 0; i < emissionObject.length; i++) {
        data.push({
          key:i,
          source: emissionObject[i].boundaryName,
          emission: emissionObject[i].emission,
        });
      }
      // //   console.log(data)
      return data;
    },
  },
};
</script>

<style lang="scss" scoped>
.Emission {
  text-align: left;
  font-size: 14px;
  color: #000;
  font-weight: 600;
}
</style>